forked from open-source-parsers/jsoncpp
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request open-source-parsers#263 from cdunn2001/static-shared
Use standard **cmake** variables, to support superprojects better. - `JSONCPP_LIB_BUILD_SHARED` -> `BUILD_SHARED_LIBS` - `JSONCPP_LIB_BUILD_STATIC` -> `BUILD_STATIC_LIBS`
- Loading branch information
Showing
9 changed files
with
23 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,38 @@ | ||
# vim: et ts=4 sts=4 sw=4 tw=0 | ||
|
||
IF(JSONCPP_LIB_BUILD_SHARED) | ||
ADD_DEFINITIONS( -DJSON_DLL ) | ||
ENDIF(JSONCPP_LIB_BUILD_SHARED) | ||
|
||
ADD_EXECUTABLE( jsoncpp_test | ||
jsontest.cpp | ||
jsontest.h | ||
main.cpp | ||
) | ||
|
||
|
||
IF(JSONCPP_LIB_BUILD_SHARED) | ||
IF(BUILD_SHARED_LIBS) | ||
ADD_DEFINITIONS( -DJSON_DLL ) | ||
TARGET_LINK_LIBRARIES(jsoncpp_test jsoncpp_lib) | ||
ELSE(JSONCPP_LIB_BUILD_SHARED) | ||
ELSE(BUILD_SHARED_LIBS) | ||
TARGET_LINK_LIBRARIES(jsoncpp_test jsoncpp_lib_static) | ||
ENDIF(JSONCPP_LIB_BUILD_SHARED) | ||
ENDIF(BUILD_SHARED_LIBS) | ||
|
||
# another way to solve issue #90 | ||
#set_target_properties(jsoncpp_test PROPERTIES COMPILE_FLAGS -ffloat-store) | ||
|
||
# Run unit tests in post-build | ||
# (default cmake workflow hides away the test result into a file, resulting in poor dev workflow?!?) | ||
IF(JSONCPP_WITH_POST_BUILD_UNITTEST) | ||
IF(JSONCPP_LIB_BUILD_SHARED) | ||
IF(BUILD_SHARED_LIBS) | ||
# First, copy the shared lib, for Microsoft. | ||
# Then, run the test executable. | ||
ADD_CUSTOM_COMMAND( TARGET jsoncpp_test | ||
POST_BUILD | ||
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:jsoncpp_lib> $<TARGET_FILE_DIR:jsoncpp_test> | ||
COMMAND $<TARGET_FILE:jsoncpp_test>) | ||
ELSE(JSONCPP_LIB_BUILD_SHARED) | ||
ELSE(BUILD_SHARED_LIBS) | ||
# Just run the test executable. | ||
ADD_CUSTOM_COMMAND( TARGET jsoncpp_test | ||
POST_BUILD | ||
COMMAND $<TARGET_FILE:jsoncpp_test>) | ||
ENDIF(JSONCPP_LIB_BUILD_SHARED) | ||
ENDIF(BUILD_SHARED_LIBS) | ||
ENDIF(JSONCPP_WITH_POST_BUILD_UNITTEST) | ||
|
||
SET_TARGET_PROPERTIES(jsoncpp_test PROPERTIES OUTPUT_NAME jsoncpp_test) |